﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAL;
using BLL;

namespace _3tiers
{
    public partial class Form_XoaBoMon : Form
    {
        public Form_XoaBoMon()
        {
            InitializeComponent();
        }
        DataAccess ac = new DataAccess();
        BLL.BLL business = new BLL.BLL();
        private void Form_XoaBoMon_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'khoaDataSet.tblKhoa' table. You can move, or remove it, as needed.
            this.tblKhoaTableAdapter.Fill(this.khoaDataSet.tblKhoa);
            // TODO: This line of code loads data into the 'quanLyLichDayDataSet14.tblBoMon' table. You can move, or remove it, as needed.
            //this.tblBoMonTableAdapter.Fill(this.quanLyLichDayDataSet14.tblBoMon);

        }

        private void cbKhoa_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string IDKhoa = cbKhoa.SelectedValue.ToString();
                string sql = "select * from tblBoMon where IDKhoa='" + IDKhoa + "'";
                DataTable dt = ac.GetTable(sql);
                cbBoMon.DataSource = dt;
                cbBoMon.DisplayMember = "TenBoMon";
                cbBoMon.ValueMember = "IDBoMon";
            }
            catch { }; 
        }
    }
}
